﻿using Demo.Api.Entities;

namespace Demo.Api.Models
{
    /// <summary>
    /// 节点信息
    /// </summary>
    public class NodeDto
    {
        /// <summary>
        ///     流程图的Id
        /// </summary>
        public long FlowChartId { get; set; }

        /// <summary>
        /// 节点名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 节点类型
        /// </summary>
        public int NodeType { get; set; }
        /// <summary>
        /// 逻辑
        /// </summary>
        public int Logic { get; set; }
        /// <summary>
        /// Or合并时，是否清空兄弟节点
        /// </summary>
        public bool OrClear { get; set; }
        /// <summary>
        /// 如果该节点是分流节点的子节点，那么该字段是最近分流节点的ID
        /// </summary>
        public long SeparateNodeId { get; set; }
        /// <summary>
        ///     规则Id
        /// </summary>
        public long RuleId { get; set; }
        /// <summary>
        ///     坐标X
        /// </summary>
        public long PositionX { get; set; }

        /// <summary>
        ///     坐标Y
        /// </summary>
        public long PositionY { get; set; }
        /// <summary>
        ///     编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        ///     说明
        /// </summary>
        public string Remarks { get; set; }
        public NodeDo To()
        {
            return new NodeDo()
            {
                FlowChartId = FlowChartId,
                SeparateNodeId = SeparateNodeId,
                Logic = Logic,
                Name = Name,
                NodeType = NodeType,
                OrClear = OrClear,
                PositionX = PositionX,
                PositionY = PositionY,
                RuleId = RuleId,
                Code = Code,
                Remarks = Remarks
            };
        }
    }
}